import gradio as gr
def update(name):
    return f"欢迎来到 Gradio, {name}!"

with gr.Blocks() as demo:
    gr.Markdown("请输入你的名字，并单机 Run 按钮。")
    big_block = gr.HTML("""
    <div style='height: 10px; width: 100px; background-color: pink;'></div>
    """)
    #在一行中增加两个文本框
    with gr.Row(variant="compact"):
        inp = gr.Textbox(placeholder="请输入你的名字：")
    with gr.Row(variant="compact"):
        out = gr.Textbox()
    btn = gr.Button("Run")
    btn.click(fn=update, inputs=inp, outputs=out)
    if True:
        # 当演示部署在 Hugging Face Spaces 上时，此按钮会触发空间复制功能；在本地环境下则无任何作用。
        gr.DuplicateButton(value="Duplicate Space for private use", elem_classes="duplicate-button")

demo.launch()
